<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 800px;
            height: 100px;
            background: blue;
        }

        span {
            /* 有效 */
            margin-left: 50px;
            padding-left: 50px;
            /* 无效 */
            margin-top: 50px;
            padding-bottom: 50px;
            border: 1px red solid;
        }
    </style>
</head>
<!-- 行内元素设置margin和padding垂直方向会失效 -->

<body>
    <!-- margin 和padding 水平有效 垂直失效 -->
    <div></div>
    <span>1</span><span>2</span>
    <div></div>
</body>

</html>